{
 "cells": [
  {
   "cell_type": "code",
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2025-01-03T03:15:17.665531Z",
     "start_time": "2025-01-03T03:15:16.609320Z"
    }
   },
   "source": [
    "import tensorflow as tf\n",
    "import numpy as np\n",
    "from sklearn.datasets import fetch_california_housing\n",
    "from sklearn.preprocessing import StandardScaler"
   ],
   "outputs": [],
   "execution_count": 1
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-01-03T03:15:31.252178Z",
     "start_time": "2025-01-03T03:15:31.227891Z"
    }
   },
   "cell_type": "code",
   "source": [
    "n_epochs = 36500\n",
    "learning_rate = 0.001\n",
    "\n",
    "housing = fetch_california_housing(data_home=\"./scikit_learn_data\", download_if_missing=True)\n",
    "m, n = housing.data.shape\n",
    "print(m, n)"
   ],
   "id": "5e3c731b82e60945",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "20640 8\n"
     ]
    }
   ],
   "execution_count": 2
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-01-03T03:19:55.232952Z",
     "start_time": "2025-01-03T03:19:55.205533Z"
    }
   },
   "cell_type": "code",
   "source": [
    "housing_data_plus_bias = np.c_[np.ones((m, 1)), housing.data]\n",
    "# 可以使用TensorFlow或者Numpy或者sklearn的StandardScaler去进行归一化\n",
    "# StandardScaler默认就做了方差归一化，和均值归一化，这两个归一化的目的都是为了更快的进行梯度下降\n",
    "# 你如何构建你的训练集，你训练除了的模型，就具备什么样的功能！\n",
    "scaler = StandardScaler(with_mean=True, with_std=True).fit(housing_data_plus_bias)\n",
    "scaled_housing_data_plus_bias = scaler.transform(housing_data_plus_bias)\n",
    "\n",
    "X = tf.constant(scaled_housing_data_plus_bias, dtype=tf.float32, name='X')\n",
    "y = tf.constant(housing.target.reshape(-1, 1), dtype=tf.float32, name='y')\n",
    "\n",
    "\n",
    "display(X)\n",
    "display(y)"
   ],
   "id": "655b66149f024fcb",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<tf.Tensor 'X_2:0' shape=(20640, 9) dtype=float32>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "<tf.Tensor 'y_2:0' shape=(20640, 1) dtype=float32>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "execution_count": 5
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-01-03T03:58:09.518974Z",
     "start_time": "2025-01-03T03:58:09.499698Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# random_uniform函数创建图里一个节点包含随机数值，给定它的形状和取值范围，就像numpy里面rand()函数\n",
    "theta = tf.Variable(tf.random_uniform([n + 1, 1], -1.0, 1.0), name='theta')\n",
    "y_pred = tf.matmul(X, theta, name=\"predictions\")\n",
    "error = y_pred - y\n",
    "rmse = tf.sqrt(tf.reduce_mean(tf.square(error), name=\"rmse\"))\n",
    "\n"
   ],
   "id": "b19b22e6c5ef1497",
   "outputs": [],
   "execution_count": 7
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-01-03T06:00:45.711541Z",
     "start_time": "2025-01-03T06:00:45.678553Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 梯度的公式：(y_pred - y) * xj\n",
    "gradients = 2/m * tf.matmul(tf.transpose(X), error)\n",
    "# 赋值函数对于BGD来说就是 theta_new = theta - (learning_rate * gradients)\n",
    "training_op = tf.assign(theta, theta - learning_rate * gradients)\n",
    "print(training_op)\n",
    "\n",
    "init = tf.global_variables_initializer()"
   ],
   "id": "ac5125d2729d2b37",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Tensor(\"Assign_2:0\", shape=(9, 1), dtype=float32_ref)\n"
     ]
    }
   ],
   "execution_count": 11
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-01-03T06:01:26.273901Z",
     "start_time": "2025-01-03T06:01:20.580742Z"
    }
   },
   "cell_type": "code",
   "source": [
    "with tf.Session() as sess:\n",
    "    sess.run(init)\n",
    "\n",
    "    for epoch in range(n_epochs):\n",
    "        if epoch % 100 == 0:\n",
    "            print(\"Epoch\", epoch, \"RMSE = \", rmse.eval())\n",
    "        sess.run(training_op)\n",
    "\n",
    "    best_theta = theta.eval()\n",
    "    print(best_theta)"
   ],
   "id": "811b2e8ec64b8d41",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch 0 RMSE =  2.8447075\n",
      "Epoch 100 RMSE =  2.6537971\n",
      "Epoch 200 RMSE =  2.5214486\n",
      "Epoch 300 RMSE =  2.4303567\n",
      "Epoch 400 RMSE =  2.3679318\n",
      "Epoch 500 RMSE =  2.325209\n",
      "Epoch 600 RMSE =  2.295916\n",
      "Epoch 700 RMSE =  2.2757306\n",
      "Epoch 800 RMSE =  2.261703\n",
      "Epoch 900 RMSE =  2.251835\n",
      "Epoch 1000 RMSE =  2.2447782\n",
      "Epoch 1100 RMSE =  2.2396255\n",
      "Epoch 1200 RMSE =  2.2357671\n",
      "Epoch 1300 RMSE =  2.2327929\n",
      "Epoch 1400 RMSE =  2.2304273\n",
      "Epoch 1500 RMSE =  2.2284842\n",
      "Epoch 1600 RMSE =  2.226838\n",
      "Epoch 1700 RMSE =  2.225404\n",
      "Epoch 1800 RMSE =  2.2241242\n",
      "Epoch 1900 RMSE =  2.222959\n",
      "Epoch 2000 RMSE =  2.2218819\n",
      "Epoch 2100 RMSE =  2.2208736\n",
      "Epoch 2200 RMSE =  2.2199209\n",
      "Epoch 2300 RMSE =  2.2190151\n",
      "Epoch 2400 RMSE =  2.2181492\n",
      "Epoch 2500 RMSE =  2.2173185\n",
      "Epoch 2600 RMSE =  2.2165196\n",
      "Epoch 2700 RMSE =  2.2157495\n",
      "Epoch 2800 RMSE =  2.2150064\n",
      "Epoch 2900 RMSE =  2.2142885\n",
      "Epoch 3000 RMSE =  2.213594\n",
      "Epoch 3100 RMSE =  2.2129223\n",
      "Epoch 3200 RMSE =  2.2122722\n",
      "Epoch 3300 RMSE =  2.2116427\n",
      "Epoch 3400 RMSE =  2.2110336\n",
      "Epoch 3500 RMSE =  2.210443\n",
      "Epoch 3600 RMSE =  2.209871\n",
      "Epoch 3700 RMSE =  2.209317\n",
      "Epoch 3800 RMSE =  2.2087803\n",
      "Epoch 3900 RMSE =  2.2082603\n",
      "Epoch 4000 RMSE =  2.2077565\n",
      "Epoch 4100 RMSE =  2.2072682\n",
      "Epoch 4200 RMSE =  2.206795\n",
      "Epoch 4300 RMSE =  2.2063363\n",
      "Epoch 4400 RMSE =  2.205892\n",
      "Epoch 4500 RMSE =  2.2054615\n",
      "Epoch 4600 RMSE =  2.205044\n",
      "Epoch 4700 RMSE =  2.2046394\n",
      "Epoch 4800 RMSE =  2.2042475\n",
      "Epoch 4900 RMSE =  2.2038677\n",
      "Epoch 5000 RMSE =  2.2034993\n",
      "Epoch 5100 RMSE =  2.2031426\n",
      "Epoch 5200 RMSE =  2.2027967\n",
      "Epoch 5300 RMSE =  2.2024615\n",
      "Epoch 5400 RMSE =  2.2021365\n",
      "Epoch 5500 RMSE =  2.2018216\n",
      "Epoch 5600 RMSE =  2.2015164\n",
      "Epoch 5700 RMSE =  2.2012205\n",
      "Epoch 5800 RMSE =  2.2009337\n",
      "Epoch 5900 RMSE =  2.2006557\n",
      "Epoch 6000 RMSE =  2.2003863\n",
      "Epoch 6100 RMSE =  2.200125\n",
      "Epoch 6200 RMSE =  2.199872\n",
      "Epoch 6300 RMSE =  2.1996264\n",
      "Epoch 6400 RMSE =  2.1993885\n",
      "Epoch 6500 RMSE =  2.1991582\n",
      "Epoch 6600 RMSE =  2.1989346\n",
      "Epoch 6700 RMSE =  2.1987178\n",
      "Epoch 6800 RMSE =  2.1985078\n",
      "Epoch 6900 RMSE =  2.198304\n",
      "Epoch 7000 RMSE =  2.1981068\n",
      "Epoch 7100 RMSE =  2.197915\n",
      "Epoch 7200 RMSE =  2.1977296\n",
      "Epoch 7300 RMSE =  2.1975498\n",
      "Epoch 7400 RMSE =  2.1973755\n",
      "Epoch 7500 RMSE =  2.1972063\n",
      "Epoch 7600 RMSE =  2.1970422\n",
      "Epoch 7700 RMSE =  2.1968832\n",
      "Epoch 7800 RMSE =  2.196729\n",
      "Epoch 7900 RMSE =  2.1965797\n",
      "Epoch 8000 RMSE =  2.1964347\n",
      "Epoch 8100 RMSE =  2.1962938\n",
      "Epoch 8200 RMSE =  2.1961577\n",
      "Epoch 8300 RMSE =  2.1960254\n",
      "Epoch 8400 RMSE =  2.1958973\n",
      "Epoch 8500 RMSE =  2.1957731\n",
      "Epoch 8600 RMSE =  2.1956525\n",
      "Epoch 8700 RMSE =  2.195536\n",
      "Epoch 8800 RMSE =  2.1954224\n",
      "Epoch 8900 RMSE =  2.1953125\n",
      "Epoch 9000 RMSE =  2.195206\n",
      "Epoch 9100 RMSE =  2.1951025\n",
      "Epoch 9200 RMSE =  2.195002\n",
      "Epoch 9300 RMSE =  2.194905\n",
      "Epoch 9400 RMSE =  2.1948104\n",
      "Epoch 9500 RMSE =  2.1947188\n",
      "Epoch 9600 RMSE =  2.1946301\n",
      "Epoch 9700 RMSE =  2.1945443\n",
      "Epoch 9800 RMSE =  2.1944606\n",
      "Epoch 9900 RMSE =  2.1943798\n",
      "Epoch 10000 RMSE =  2.194301\n",
      "Epoch 10100 RMSE =  2.1942246\n",
      "Epoch 10200 RMSE =  2.1941507\n",
      "Epoch 10300 RMSE =  2.194079\n",
      "Epoch 10400 RMSE =  2.1940095\n",
      "Epoch 10500 RMSE =  2.1939418\n",
      "Epoch 10600 RMSE =  2.1938765\n",
      "Epoch 10700 RMSE =  2.1938126\n",
      "Epoch 10800 RMSE =  2.193751\n",
      "Epoch 10900 RMSE =  2.1936913\n",
      "Epoch 11000 RMSE =  2.1936328\n",
      "Epoch 11100 RMSE =  2.1935763\n",
      "Epoch 11200 RMSE =  2.193522\n",
      "Epoch 11300 RMSE =  2.1934688\n",
      "Epoch 11400 RMSE =  2.1934173\n",
      "Epoch 11500 RMSE =  2.1933672\n",
      "Epoch 11600 RMSE =  2.1933186\n",
      "Epoch 11700 RMSE =  2.1932716\n",
      "Epoch 11800 RMSE =  2.1932256\n",
      "Epoch 11900 RMSE =  2.1931815\n",
      "Epoch 12000 RMSE =  2.1931384\n",
      "Epoch 12100 RMSE =  2.1930966\n",
      "Epoch 12200 RMSE =  2.1930559\n",
      "Epoch 12300 RMSE =  2.1930168\n",
      "Epoch 12400 RMSE =  2.1929781\n",
      "Epoch 12500 RMSE =  2.1929412\n",
      "Epoch 12600 RMSE =  2.1929052\n",
      "Epoch 12700 RMSE =  2.1928701\n",
      "Epoch 12800 RMSE =  2.192836\n",
      "Epoch 12900 RMSE =  2.192803\n",
      "Epoch 13000 RMSE =  2.192771\n",
      "Epoch 13100 RMSE =  2.19274\n",
      "Epoch 13200 RMSE =  2.1927097\n",
      "Epoch 13300 RMSE =  2.1926804\n",
      "Epoch 13400 RMSE =  2.192652\n",
      "Epoch 13500 RMSE =  2.1926243\n",
      "Epoch 13600 RMSE =  2.1925974\n",
      "Epoch 13700 RMSE =  2.1925712\n",
      "Epoch 13800 RMSE =  2.1925457\n",
      "Epoch 13900 RMSE =  2.1925213\n",
      "Epoch 14000 RMSE =  2.1924975\n",
      "Epoch 14100 RMSE =  2.1924741\n",
      "Epoch 14200 RMSE =  2.1924517\n",
      "Epoch 14300 RMSE =  2.1924298\n",
      "Epoch 14400 RMSE =  2.1924083\n",
      "Epoch 14500 RMSE =  2.1923876\n",
      "Epoch 14600 RMSE =  2.1923673\n",
      "Epoch 14700 RMSE =  2.192348\n",
      "Epoch 14800 RMSE =  2.1923292\n",
      "Epoch 14900 RMSE =  2.1923106\n",
      "Epoch 15000 RMSE =  2.1922927\n",
      "Epoch 15100 RMSE =  2.1922753\n",
      "Epoch 15200 RMSE =  2.1922586\n",
      "Epoch 15300 RMSE =  2.192242\n",
      "Epoch 15400 RMSE =  2.1922257\n",
      "Epoch 15500 RMSE =  2.1922104\n",
      "Epoch 15600 RMSE =  2.1921952\n",
      "Epoch 15700 RMSE =  2.1921806\n",
      "Epoch 15800 RMSE =  2.1921663\n",
      "Epoch 15900 RMSE =  2.1921525\n",
      "Epoch 16000 RMSE =  2.1921387\n",
      "Epoch 16100 RMSE =  2.1921258\n",
      "Epoch 16200 RMSE =  2.1921132\n",
      "Epoch 16300 RMSE =  2.1921005\n",
      "Epoch 16400 RMSE =  2.1920886\n",
      "Epoch 16500 RMSE =  2.1920767\n",
      "Epoch 16600 RMSE =  2.1920655\n",
      "Epoch 16700 RMSE =  2.1920543\n",
      "Epoch 16800 RMSE =  2.1920438\n",
      "Epoch 16900 RMSE =  2.192033\n",
      "Epoch 17000 RMSE =  2.192023\n",
      "Epoch 17100 RMSE =  2.1920133\n",
      "Epoch 17200 RMSE =  2.1920035\n",
      "Epoch 17300 RMSE =  2.1919944\n",
      "Epoch 17400 RMSE =  2.1919851\n",
      "Epoch 17500 RMSE =  2.191976\n",
      "Epoch 17600 RMSE =  2.1919675\n",
      "Epoch 17700 RMSE =  2.1919591\n",
      "Epoch 17800 RMSE =  2.191951\n",
      "Epoch 17900 RMSE =  2.1919427\n",
      "Epoch 18000 RMSE =  2.191935\n",
      "Epoch 18100 RMSE =  2.1919277\n",
      "Epoch 18200 RMSE =  2.1919203\n",
      "Epoch 18300 RMSE =  2.1919134\n",
      "Epoch 18400 RMSE =  2.1919062\n",
      "Epoch 18500 RMSE =  2.1918998\n",
      "Epoch 18600 RMSE =  2.1918929\n",
      "Epoch 18700 RMSE =  2.1918864\n",
      "Epoch 18800 RMSE =  2.1918802\n",
      "Epoch 18900 RMSE =  2.1918743\n",
      "Epoch 19000 RMSE =  2.1918683\n",
      "Epoch 19100 RMSE =  2.1918628\n",
      "Epoch 19200 RMSE =  2.191857\n",
      "Epoch 19300 RMSE =  2.1918516\n",
      "Epoch 19400 RMSE =  2.1918461\n",
      "Epoch 19500 RMSE =  2.1918411\n",
      "Epoch 19600 RMSE =  2.1918359\n",
      "Epoch 19700 RMSE =  2.191831\n",
      "Epoch 19800 RMSE =  2.1918263\n",
      "Epoch 19900 RMSE =  2.1918218\n",
      "Epoch 20000 RMSE =  2.1918173\n",
      "Epoch 20100 RMSE =  2.1918128\n",
      "Epoch 20200 RMSE =  2.1918087\n",
      "Epoch 20300 RMSE =  2.1918044\n",
      "Epoch 20400 RMSE =  2.1918004\n",
      "Epoch 20500 RMSE =  2.1917963\n",
      "Epoch 20600 RMSE =  2.1917925\n",
      "Epoch 20700 RMSE =  2.1917887\n",
      "Epoch 20800 RMSE =  2.1917849\n",
      "Epoch 20900 RMSE =  2.1917815\n",
      "Epoch 21000 RMSE =  2.191778\n",
      "Epoch 21100 RMSE =  2.1917746\n",
      "Epoch 21200 RMSE =  2.191771\n",
      "Epoch 21300 RMSE =  2.191768\n",
      "Epoch 21400 RMSE =  2.1917648\n",
      "Epoch 21500 RMSE =  2.191762\n",
      "Epoch 21600 RMSE =  2.1917589\n",
      "Epoch 21700 RMSE =  2.1917558\n",
      "Epoch 21800 RMSE =  2.1917531\n",
      "Epoch 21900 RMSE =  2.1917503\n",
      "Epoch 22000 RMSE =  2.1917474\n",
      "Epoch 22100 RMSE =  2.191745\n",
      "Epoch 22200 RMSE =  2.1917422\n",
      "Epoch 22300 RMSE =  2.1917398\n",
      "Epoch 22400 RMSE =  2.1917374\n",
      "Epoch 22500 RMSE =  2.191735\n",
      "Epoch 22600 RMSE =  2.1917326\n",
      "Epoch 22700 RMSE =  2.1917305\n",
      "Epoch 22800 RMSE =  2.1917284\n",
      "Epoch 22900 RMSE =  2.191726\n",
      "Epoch 23000 RMSE =  2.191724\n",
      "Epoch 23100 RMSE =  2.1917217\n",
      "Epoch 23200 RMSE =  2.1917198\n",
      "Epoch 23300 RMSE =  2.1917179\n",
      "Epoch 23400 RMSE =  2.1917162\n",
      "Epoch 23500 RMSE =  2.1917143\n",
      "Epoch 23600 RMSE =  2.1917124\n",
      "Epoch 23700 RMSE =  2.1917105\n",
      "Epoch 23800 RMSE =  2.1917088\n",
      "Epoch 23900 RMSE =  2.1917071\n",
      "Epoch 24000 RMSE =  2.1917055\n",
      "Epoch 24100 RMSE =  2.191704\n",
      "Epoch 24200 RMSE =  2.1917024\n",
      "Epoch 24300 RMSE =  2.1917007\n",
      "Epoch 24400 RMSE =  2.1916993\n",
      "Epoch 24500 RMSE =  2.1916978\n",
      "Epoch 24600 RMSE =  2.1916964\n",
      "Epoch 24700 RMSE =  2.191695\n",
      "Epoch 24800 RMSE =  2.1916938\n",
      "Epoch 24900 RMSE =  2.1916924\n",
      "Epoch 25000 RMSE =  2.1916912\n",
      "Epoch 25100 RMSE =  2.1916897\n",
      "Epoch 25200 RMSE =  2.1916885\n",
      "Epoch 25300 RMSE =  2.1916876\n",
      "Epoch 25400 RMSE =  2.1916862\n",
      "Epoch 25500 RMSE =  2.1916852\n",
      "Epoch 25600 RMSE =  2.191684\n",
      "Epoch 25700 RMSE =  2.1916826\n",
      "Epoch 25800 RMSE =  2.1916816\n",
      "Epoch 25900 RMSE =  2.1916807\n",
      "Epoch 26000 RMSE =  2.19168\n",
      "Epoch 26100 RMSE =  2.1916788\n",
      "Epoch 26200 RMSE =  2.1916776\n",
      "Epoch 26300 RMSE =  2.1916766\n",
      "Epoch 26400 RMSE =  2.191676\n",
      "Epoch 26500 RMSE =  2.191675\n",
      "Epoch 26600 RMSE =  2.191674\n",
      "Epoch 26700 RMSE =  2.191673\n",
      "Epoch 26800 RMSE =  2.1916723\n",
      "Epoch 26900 RMSE =  2.1916714\n",
      "Epoch 27000 RMSE =  2.1916707\n",
      "Epoch 27100 RMSE =  2.19167\n",
      "Epoch 27200 RMSE =  2.191669\n",
      "Epoch 27300 RMSE =  2.1916685\n",
      "Epoch 27400 RMSE =  2.1916676\n",
      "Epoch 27500 RMSE =  2.1916666\n",
      "Epoch 27600 RMSE =  2.191666\n",
      "Epoch 27700 RMSE =  2.1916656\n",
      "Epoch 27800 RMSE =  2.1916647\n",
      "Epoch 27900 RMSE =  2.191664\n",
      "Epoch 28000 RMSE =  2.1916635\n",
      "Epoch 28100 RMSE =  2.1916628\n",
      "Epoch 28200 RMSE =  2.1916623\n",
      "Epoch 28300 RMSE =  2.1916616\n",
      "Epoch 28400 RMSE =  2.191661\n",
      "Epoch 28500 RMSE =  2.1916604\n",
      "Epoch 28600 RMSE =  2.1916597\n",
      "Epoch 28700 RMSE =  2.1916592\n",
      "Epoch 28800 RMSE =  2.191659\n",
      "Epoch 28900 RMSE =  2.191658\n",
      "Epoch 29000 RMSE =  2.1916575\n",
      "Epoch 29100 RMSE =  2.191657\n",
      "Epoch 29200 RMSE =  2.1916566\n",
      "Epoch 29300 RMSE =  2.1916564\n",
      "Epoch 29400 RMSE =  2.1916559\n",
      "Epoch 29500 RMSE =  2.1916552\n",
      "Epoch 29600 RMSE =  2.191655\n",
      "Epoch 29700 RMSE =  2.1916542\n",
      "Epoch 29800 RMSE =  2.191654\n",
      "Epoch 29900 RMSE =  2.1916535\n",
      "Epoch 30000 RMSE =  2.191653\n",
      "Epoch 30100 RMSE =  2.1916528\n",
      "Epoch 30200 RMSE =  2.191652\n",
      "Epoch 30300 RMSE =  2.1916518\n",
      "Epoch 30400 RMSE =  2.1916516\n",
      "Epoch 30500 RMSE =  2.191651\n",
      "Epoch 30600 RMSE =  2.1916506\n",
      "Epoch 30700 RMSE =  2.1916504\n",
      "Epoch 30800 RMSE =  2.1916502\n",
      "Epoch 30900 RMSE =  2.1916497\n",
      "Epoch 31000 RMSE =  2.1916494\n",
      "Epoch 31100 RMSE =  2.191649\n",
      "Epoch 31200 RMSE =  2.1916487\n",
      "Epoch 31300 RMSE =  2.1916485\n",
      "Epoch 31400 RMSE =  2.1916482\n",
      "Epoch 31500 RMSE =  2.1916478\n",
      "Epoch 31600 RMSE =  2.1916475\n",
      "Epoch 31700 RMSE =  2.1916473\n",
      "Epoch 31800 RMSE =  2.191647\n",
      "Epoch 31900 RMSE =  2.1916468\n",
      "Epoch 32000 RMSE =  2.1916463\n",
      "Epoch 32100 RMSE =  2.191646\n",
      "Epoch 32200 RMSE =  2.1916459\n",
      "Epoch 32300 RMSE =  2.1916456\n",
      "Epoch 32400 RMSE =  2.1916454\n",
      "Epoch 32500 RMSE =  2.1916451\n",
      "Epoch 32600 RMSE =  2.191645\n",
      "Epoch 32700 RMSE =  2.1916447\n",
      "Epoch 32800 RMSE =  2.1916444\n",
      "Epoch 32900 RMSE =  2.191644\n",
      "Epoch 33000 RMSE =  2.1916437\n",
      "Epoch 33100 RMSE =  2.1916437\n",
      "Epoch 33200 RMSE =  2.1916435\n",
      "Epoch 33300 RMSE =  2.1916432\n",
      "Epoch 33400 RMSE =  2.191643\n",
      "Epoch 33500 RMSE =  2.191643\n",
      "Epoch 33600 RMSE =  2.1916428\n",
      "Epoch 33700 RMSE =  2.1916425\n",
      "Epoch 33800 RMSE =  2.1916423\n",
      "Epoch 33900 RMSE =  2.191642\n",
      "Epoch 34000 RMSE =  2.191642\n",
      "Epoch 34100 RMSE =  2.1916416\n",
      "Epoch 34200 RMSE =  2.1916413\n",
      "Epoch 34300 RMSE =  2.1916413\n",
      "Epoch 34400 RMSE =  2.1916413\n",
      "Epoch 34500 RMSE =  2.1916413\n",
      "Epoch 34600 RMSE =  2.1916409\n",
      "Epoch 34700 RMSE =  2.1916409\n",
      "Epoch 34800 RMSE =  2.1916406\n",
      "Epoch 34900 RMSE =  2.1916404\n",
      "Epoch 35000 RMSE =  2.1916404\n",
      "Epoch 35100 RMSE =  2.1916401\n",
      "Epoch 35200 RMSE =  2.1916401\n",
      "Epoch 35300 RMSE =  2.19164\n",
      "Epoch 35400 RMSE =  2.1916397\n",
      "Epoch 35500 RMSE =  2.1916397\n",
      "Epoch 35600 RMSE =  2.1916394\n",
      "Epoch 35700 RMSE =  2.1916392\n",
      "Epoch 35800 RMSE =  2.191639\n",
      "Epoch 35900 RMSE =  2.191639\n",
      "Epoch 36000 RMSE =  2.191639\n",
      "Epoch 36100 RMSE =  2.191639\n",
      "Epoch 36200 RMSE =  2.1916387\n",
      "Epoch 36300 RMSE =  2.1916385\n",
      "Epoch 36400 RMSE =  2.1916385\n"
     ]
    }
   ],
   "execution_count": 13
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": "",
   "id": "7c80f1599813ee81"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
